package com.koron.system.rocketMq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @ClassName Producer
 * @description
 * @Author zhouj
 * @Date 2021/7/19 15:41
 */
@Slf4j
@Component
public class Producer {

    /*@Resource
    private TestChannel testChannel;*/

    /*public String testStream(AppBean appBean){

        if (StringUtils.isEmpty(appBean.getMark())) {
            log.error("数据源标识为空");
            return null;
        }

        String jsonString = JSON.toJSONString(appBean);

        String messageId = IdUtil.simpleUUID();
        Message<String> message = MessageBuilder
                .withPayload(jsonString)
                .setHeader(MessageConst.PROPERTY_TAGS, "test")
                .build();
        try {
            testChannel.output1().send(message,10000);
            log.info(messageId + "发送成功");
            return messageId + "发送成功";
        } catch (Exception e) {
            log.error(messageId + "发送失败，原因：{}",e.getMessage());
            return messageId + "发送失败，原因：" + e.getMessage();
        }
    }*/

}
